<?php include($folder.'/layouts/templates/backend/header.tpl') ?>
<?php
$master['action'] = null;
$master['attributes'] = null;
$master['pageTitle'] = 'Írások';
$master['toolbarItems'] = array(
	'<input type="button" class="button" onclick="javascript:location.href=\''.$prefix.'/adminisztracio/cikkek/modositas\'" value="Új írás" />',
	'<input type="button" value="Vissza" class="button" onclick="javascript:window.location.href=\''.$prefix.'/adminisztracio\'" />'
);
?>
<script type="text/javascript">
function CikkDelete(textID)
{
	if (confirm('Biztos, hogy törölni szeretnéd?')) 
	{ 
		SubmitForm('text_delete', {'textToDelete':textID}) 
	}
}
</script>
<?php include($folder.'/layouts/templates/backend/middle.tpl') ?>
<?php if (!empty($_SESSION['id'])): ?>
<input type="hidden" name="textToDelete" id="textToDelete" />
<?php $content['itemsPerPage'] = 18; ?>
<?php echo extendedTable(array(
	'header' => paginator(array(
		'subId' => 'paginator1',
		'id' => 'main',
		'selectCountMethod' => 'cikkek_select_count',
		'itemsPerPage' => $content['itemsPerPage'],
		'itemsPerPageAll' => array(9,18,36,72))),
	'body' => table(array(
		'id' => 'main',
		'selectMethod' => 'cikkek_select',
		'block' => 0,
		'itemsPerPage' => $content['itemsPerPage'],
		'sortColumn' => 'textCreated',
		'sortDirection' => 'desc',
		'columns' => array(
			array('title'=>'cím', 'template'=>'{textTitle}', 'width'=>'', 'align'=>'left', 'sortColumn'=>'textTitle'),
			array('title'=>'kategória', 'template'=>'{textCategoryDescription}', 'width'=>'', 'align'=>'left', 'sortColumn'=>'textCategoryDescription'),
			array('title'=>'időpont', 'template'=>'{textCreated}', 'width'=>'150px', 'align'=>'left', 'sortColumn'=>'textCreated'),
			array('title'=>'művelet', 
				'template'=>'<a href="'.$prefix.'/adminisztracio/cikkek/modositas?id={textID}">módosítás</a>
							 <a href="javascript:CikkDelete({textID})">törlés</a>',
							 'width'=>'100px', 'align'=>'center', 'sortColumn'=>'')
		))),
	'footer' => paginator(array(
		'subId' => 'paginator2',
		'isFirst' => false,
		'id' => 'main',
		'selectCountMethod' => 'cikkek_select_count',
		'itemsPerPage' => $content['itemsPerPage'],
		'itemsPerPageAll' => array(9,18,36,72))))) ?>
<?php endif; ?>
<?php include($folder.'/layouts/templates/backend/footer.tpl') ?>